﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PSMock.Implementation;

namespace PSMock
{
	/// <summary>
	/// The options for mocking a set property.
	/// </summary>
	/// <typeparam name="T1">The type of the 1.</typeparam>
	public class SetPropertyOption<T1> : Option
	{
		public SetPropertyOption(MockedFunction mockedFunction)
			: base(mockedFunction) { }

		/// <summary>
		/// Conditions for mocking the property
		/// </summary>
		/// <param name="predicate">The predicate.</param>
		public SetPropertyOption<T1> Condition(Func<T1, bool> predicate)
		{
			mockedFunction.Condition = predicate;
			return this;
		}


		/// <summary>
		/// The action to mock the property.
		/// </summary>
		public Option Do(Action<T1> method)
		{
			mockedFunction.Function = method;
			return this;
		}
	}
}
